package com.sky.mapper;


import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper  {

    //添加分类名称
    @AutoFill(value = OperationType.INSERT)
    void addCategory(Category category);

    //对分类进行分页展示
    Page<Category> getCategoryPage(CategoryPageQueryDTO categoryPageQueryDTO);

    //删除分类
    void deleteCategory(Integer i);

    //更新分类信息
    @AutoFill(value = OperationType.UPDATE)
    void updateCategory(Category category);

    //根据类型(菜品,套餐)展示分类
    List<Category> list(Integer type);

    //根据id获取分类对象
    Category getCategoryById(Long id);
}
